using Demo.WebApplication.Models;
using Microsoft.AspNetCore.Mvc;

namespace Demo.WebApplication.Controllers
{
    /// <summary>
    /// classe controleur de test
    /// </summary>
    public class TestController : Controller
    {
        /// <summary>
        /// retourne la vue index.cshtml
        /// </summary>
        /// <returns></returns>
        public IActionResult Index()
        {
            return this.View();
        }

        /// <summary>
        /// retourne la vue index.cshtml
        /// </summary>
        /// <returns></returns>
        public IActionResult Deuxieme()
        {
            int variable = 12;

            return this.View(variable);
        }

        /// <summary>
        /// retourne la vue Troisieme.cshtml
        /// </summary>
        /// <returns></returns>
        public IActionResult Troisieme()
        {
            int valeur = 13;
            var model = new TroisiemeViewModel() { Valeur = valeur };
            //model.valeur = valeur; deuxième façon de faire
            return this.View(model);
        }

        /// <summary>
        /// retourne la vue Troisieme.cshtml
        /// </summary>
        /// <returns></returns>
        public IActionResult Quatrieme()
        {
            int[,] Tablo = new int[4, 2];
            Tablo[0, 0] = 1;
            var model = new QuatriemeViewModel() { Tablo = Tablo };
            return this.View(model);
        }
    }
}
